'use client'

import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs'
import { Badge } from '@/components/ui/badge'
import { Button } from '@/components/ui/button'
import { Input } from '@/components/ui/input'
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select'
import { 
  FileText, 
  Cpu, 
  TestTube, 
  Package, 
  FolderOpen, 
  Search, 
  Filter,
  Download,
  Eye,
  Edit,
  Plus,
  Calendar,
  User,
  AlertTriangle,
  CheckCircle,
  Clock
} from 'lucide-react'

interface DocumentManagementProps {
  project: any
}

// 设计资料组件
function DesignDocuments({ project }: { project: any }) {
  const getStatusColor = (status: string) => {
    const colors: Record<string, string> = {
      DESIGN: 'bg-purple-100 text-purple-800',
      PROTOTYPE: 'bg-orange-100 text-orange-800',
      TESTING: 'bg-yellow-100 text-yellow-800',
      VALIDATION: 'bg-blue-100 text-blue-800',
      PRODUCTION: 'bg-green-100 text-green-800',
      OBSOLETE: 'bg-gray-100 text-gray-800',
      DRAFT: 'bg-gray-100 text-gray-800',
      REVIEW: 'bg-yellow-100 text-yellow-800',
      APPROVED: 'bg-green-100 text-green-800',
      PRODUCTION: 'bg-blue-100 text-blue-800',
      ARCHIVED: 'bg-red-100 text-red-800',
      // 文档状态
      DRAFT: 'bg-gray-100 text-gray-800',
      REVIEW: 'bg-yellow-100 text-yellow-800',
      APPROVED: 'bg-green-100 text-green-800',
      OBSOLETE: 'bg-red-100 text-red-800',
      ARCHIVED: 'bg-gray-100 text-gray-800'
    }
    return colors[status] || 'bg-gray-100 text-gray-800'
  }

  const getStatusLabel = (status: string) => {
    const labels: Record<string, string> = {
      DESIGN: '设计阶段',
      PROTOTYPE: '原型制作',
      TESTING: '测试阶段',
      VALIDATION: '验证阶段',
      PRODUCTION: '生产阶段',
      OBSOLETE: '已淘汰',
      DRAFT: '草稿',
      REVIEW: '审核中',
      APPROVED: '已批准',
      PRODUCTION: '生产中',
      ARCHIVED: '已归档',
      // 文档状态
      DRAFT: '草稿',
      REVIEW: '审核中',
      APPROVED: '已批准',
      OBSOLETE: '已废弃',
      ARCHIVED: '已归档'
    }
    return labels[status] || status
  }

  return (
    <div className="space-y-6">
      {/* 硬件版本 */}
      <Card>
        <CardHeader>
          <CardTitle className="flex items-center space-x-2">
            <Cpu className="h-5 w-5" />
            <span>硬件版本</span>
            <Badge variant="secondary">{project.hardwareVersions?.length || 0}</Badge>
          </CardTitle>
          <CardDescription>
            管理硬件设计版本和设计文件
          </CardDescription>
        </CardHeader>
        <CardContent>
          {project.hardwareVersions?.length === 0 ? (
            <div className="text-center py-8">
              <Cpu className="mx-auto h-12 w-12 text-gray-400 mb-4" />
              <p className="text-gray-500">暂无硬件版本</p>
            </div>
          ) : (
            <div className="space-y-4">
              {project.hardwareVersions.map((version: any) => (
                <div key={version.id} className="border rounded-lg p-4">
                  <div className="flex items-start justify-between">
                    <div className="space-y-2">
                      <div className="flex items-center space-x-2">
                        <Badge className={getStatusColor(version.status)}>
                          {getStatusLabel(version.status)}
                        </Badge>
                        <Badge variant="outline">v{version.version}</Badge>
                      </div>
                      <h4 className="font-medium">{version.name}</h4>
                      {version.bom && (
                        <div className="flex items-center space-x-2 mt-1">
                          <Package className="h-4 w-4 text-blue-600" />
                          <span className="text-sm text-blue-600">
                            关联BOM: {version.bom.name} (v{version.bom.version})
                          </span>
                          <Badge className={getStatusColor(version.bom.status)}>
                            {getStatusLabel(version.bom.status)}
                          </Badge>
                        </div>
                      )}
                      {version.cost && (
                        <p className="text-sm text-green-600">版本成本: ¥{version.cost.toLocaleString()}</p>
                      )}
                      <div className="flex items-center space-x-4 text-sm text-gray-500">
                        <div className="flex items-center space-x-1">
                          <Calendar className="h-4 w-4" />
                          <span>{new Date(version.createdAt).toLocaleDateString('zh-CN')}</span>
                        </div>
                      </div>
                    </div>
                    <div className="flex items-center space-x-2">
                      <Button variant="outline" size="sm">
                        <Eye className="h-4 w-4 mr-2" />
                        查看详情
                      </Button>
                      <Button variant="ghost" size="sm">
                        <Download className="h-4 w-4" />
                      </Button>
                    </div>
                  </div>
                  
                  {/* 设计文件 */}
                  <div className="mt-4 pt-4 border-t">
                    <h5 className="text-sm font-medium mb-2">设计文件</h5>
                    {version.documents && version.documents.length > 0 ? (
                      <div className="grid grid-cols-1 gap-3">
                        {version.documents.map((docRef: any) => (
                          <div key={docRef.id} className="flex items-center justify-between p-3 bg-gray-50 rounded-lg">
                            <div className="flex items-center space-x-3">
                              <FileText className="h-5 w-5 text-blue-600" />
                              <div>
                                <p className="font-medium">{docRef.document.name}</p>
                                <div className="flex items-center space-x-2 mt-1">
                                  <Badge variant="outline">{docRef.document.type}</Badge>
                                  <Badge variant="secondary">v{docRef.document.version}</Badge>
                                  <Badge className={getStatusColor(docRef.document.status)}>
                                    {getStatusLabel(docRef.document.status)}
                                  </Badge>
                                </div>
                                {docRef.notes && (
                                  <p className="text-sm text-gray-600 mt-1">{docRef.notes}</p>
                                )}
                              </div>
                            </div>
                            <div className="flex items-center space-x-2">
                              {docRef.document.filePath ? (
                                <Button variant="ghost" size="sm">
                                  <Download className="h-4 w-4" />
                                </Button>
                              ) : (
                                <span className="text-xs text-gray-400">文件未上传</span>
                              )}
                              <Button variant="outline" size="sm">
                                <Eye className="h-4 w-4 mr-2" />
                                详情
                              </Button>
                            </div>
                          </div>
                        ))}
                      </div>
                    ) : (
                      <div className="text-center py-6 text-gray-500">
                        <FileText className="mx-auto h-8 w-8 text-gray-400 mb-2" />
                        <p>暂无关联的设计文件</p>
                        <Button variant="outline" size="sm" className="mt-2">
                          <Plus className="h-4 w-4 mr-2" />
                          关联文档
                        </Button>
                      </div>
                    )}
                  </div>
                </div>
              ))}
            </div>
          )}
        </CardContent>
      </Card>

      {/* BOM清单 */}
      <Card>
        <CardHeader>
          <CardTitle className="flex items-center space-x-2">
            <Package className="h-5 w-5" />
            <span>BOM清单</span>
            <Badge variant="secondary">{project.boms?.length || 0}</Badge>
          </CardTitle>
          <CardDescription>
            管理物料清单和供应链信息
          </CardDescription>
        </CardHeader>
        <CardContent>
          {project.boms?.length === 0 ? (
            <div className="text-center py-8">
              <Package className="mx-auto h-12 w-12 text-gray-400 mb-4" />
              <p className="text-gray-500">暂无BOM清单</p>
            </div>
          ) : (
            <div className="space-y-4">
              {project.boms.map((bom: any) => (
                <div key={bom.id} className="border rounded-lg p-4">
                  <div className="flex items-start justify-between">
                    <div className="space-y-2">
                      <div className="flex items-center space-x-2">
                        <Badge className={getStatusColor(bom.status)}>
                          {getStatusLabel(bom.status)}
                        </Badge>
                        <Badge variant="outline">v{bom.version}</Badge>
                      </div>
                      <h4 className="font-medium">{bom.name}</h4>
                      {bom.totalCost && (
                        <p className="text-sm text-green-600">总成本: ¥{bom.totalCost.toLocaleString()}</p>
                      )}
                      <div className="flex items-center space-x-4 text-sm text-gray-500">
                        <div className="flex items-center space-x-1">
                          <Calendar className="h-4 w-4" />
                          <span>{new Date(bom.createdAt).toLocaleDateString('zh-CN')}</span>
                        </div>
                      </div>
                    </div>
                    <div className="flex items-center space-x-2">
                      <Button variant="outline" size="sm">
                        <Eye className="h-4 w-4 mr-2" />
                        查看详情
                      </Button>
                      <Button variant="ghost" size="sm">
                        <Download className="h-4 w-4" />
                      </Button>
                    </div>
                  </div>
                </div>
              ))}
            </div>
          )}
        </CardContent>
      </Card>
    </div>
  )
}

// 测试资料组件
function TestDocuments({ project }: { project: any }) {
  const getStatusColor = (status: string) => {
    const colors: Record<string, string> = {
      PLANNED: 'bg-gray-100 text-gray-800',
      IN_PROGRESS: 'bg-yellow-100 text-yellow-800',
      PASSED: 'bg-green-100 text-green-800',
      FAILED: 'bg-red-100 text-red-800',
      BLOCKED: 'bg-orange-100 text-orange-800',
      CANCELLED: 'bg-gray-100 text-gray-800',
      PASS: 'bg-green-100 text-green-800',
      FAIL: 'bg-red-100 text-red-800',
      PARTIAL: 'bg-yellow-100 text-yellow-800',
      NOT_TESTED: 'bg-gray-100 text-gray-800'
    }
    return colors[status] || 'bg-gray-100 text-gray-800'
  }

  const getStatusLabel = (status: string) => {
    const labels: Record<string, string> = {
      PLANNED: '计划中',
      IN_PROGRESS: '进行中',
      PASSED: '通过',
      FAILED: '失败',
      BLOCKED: '阻塞',
      CANCELLED: '已取消',
      PASS: '通过',
      FAIL: '失败',
      PARTIAL: '部分通过',
      NOT_TESTED: '未测试'
    }
    return labels[status] || status
  }

  return (
    <div className="space-y-6">
      {/* 硬件测试 */}
      <Card>
        <CardHeader>
          <CardTitle className="flex items-center space-x-2">
            <TestTube className="h-5 w-5" />
            <span>硬件测试</span>
            <Badge variant="secondary">{project.hardwareTests?.length || 0}</Badge>
          </CardTitle>
          <CardDescription>
            硬件产品测试计划和报告
          </CardDescription>
        </CardHeader>
        <CardContent>
          {project.hardwareTests?.length === 0 ? (
            <div className="text-center py-8">
              <TestTube className="mx-auto h-12 w-12 text-gray-400 mb-4" />
              <p className="text-gray-500">暂无硬件测试</p>
            </div>
          ) : (
            <div className="space-y-4">
              {project.hardwareTests.map((test: any) => (
                <div key={test.id} className="border rounded-lg p-4">
                  <div className="flex items-start justify-between">
                    <div className="space-y-2">
                      <div className="flex items-center space-x-2">
                        <Badge className={getStatusColor(test.status)}>
                          {getStatusLabel(test.status)}
                        </Badge>
                        {test.passFail && (
                          <Badge variant={test.passFail === 'PASS' ? 'default' : 'destructive'}>
                            {test.passFail === 'PASS' ? '通过' : '失败'}
                          </Badge>
                        )}
                      </div>
                      <h4 className="font-medium">{test.name}</h4>
                      {test.description && (
                        <p className="text-sm text-gray-600">{test.description}</p>
                      )}
                      <div className="flex items-center space-x-4 text-sm text-gray-500">
                        {test.hardwareVersion && (
                          <span>版本: {test.hardwareVersion.name}</span>
                        )}
                        {test.testDate && (
                          <div className="flex items-center space-x-1">
                            <Calendar className="h-4 w-4" />
                            <span>{new Date(test.testDate).toLocaleDateString('zh-CN')}</span>
                          </div>
                        )}
                        {test.tester && (
                          <div className="flex items-center space-x-1">
                            <User className="h-4 w-4" />
                            <span>{test.tester.name}</span>
                          </div>
                        )}
                      </div>
                    </div>
                    <div className="flex items-center space-x-2">
                      <Button variant="outline" size="sm">
                        <Eye className="h-4 w-4 mr-2" />
                        查看详情
                      </Button>
                    </div>
                  </div>
                  
                  {/* 测试文档 */}
                  <div className="mt-4 pt-4 border-t">
                    <h5 className="text-sm font-medium mb-2">测试文档</h5>
                    <div className="grid grid-cols-3 gap-4">
                      <div className="flex items-center justify-between p-2 bg-gray-50 rounded">
                        <div className="flex items-center space-x-2">
                          <FileText className="h-4 w-4 text-blue-600" />
                          <span className="text-sm">测试计划</span>
                        </div>
                        <span className="text-xs text-gray-400">未上传</span>
                      </div>
                      <div className="flex items-center justify-between p-2 bg-gray-50 rounded">
                        <div className="flex items-center space-x-2">
                          <FileText className="h-4 w-4 text-green-600" />
                          <span className="text-sm">测试报告</span>
                        </div>
                        <span className="text-xs text-gray-400">未上传</span>
                      </div>
                      <div className="flex items-center justify-between p-2 bg-gray-50 rounded">
                        <div className="flex items-center space-x-2">
                          <FileText className="h-4 w-4 text-purple-600" />
                          <span className="text-sm">测试标准</span>
                        </div>
                        <span className="text-xs text-gray-400">未上传</span>
                      </div>
                    </div>
                  </div>
                </div>
              ))}
            </div>
          )}
        </CardContent>
      </Card>

      {/* 质量报告 */}
      <Card>
        <CardHeader>
          <CardTitle className="flex items-center space-x-2">
            <CheckCircle className="h-5 w-5" />
            <span>质量报告</span>
            <Badge variant="secondary">{project.qualityReports?.length || 0}</Badge>
          </CardTitle>
          <CardDescription>
            产品质量检测报告和记录
          </CardDescription>
        </CardHeader>
        <CardContent>
          {project.qualityReports?.length === 0 ? (
            <div className="text-center py-8">
              <CheckCircle className="mx-auto h-12 w-12 text-gray-400 mb-4" />
              <p className="text-gray-500">暂无质量报告</p>
            </div>
          ) : (
            <div className="space-y-4">
              {project.qualityReports.map((report: any) => (
                <div key={report.id} className="border rounded-lg p-4">
                  <div className="flex items-start justify-between">
                    <div className="space-y-2">
                      <div className="flex items-center space-x-2">
                        <Badge variant="outline">{report.reportType}</Badge>
                        {report.batchNumber && (
                          <Badge variant="secondary">批次: {report.batchNumber}</Badge>
                        )}
                      </div>
                      <h4 className="font-medium">检测结果: {report.result}</h4>
                      {report.issues && (
                        <p className="text-sm text-red-600">问题: {report.issues}</p>
                      )}
                      <div className="flex items-center space-x-4 text-sm text-gray-500">
                        {report.productionOrder && (
                          <span>订单: {report.productionOrder.orderNumber}</span>
                        )}
                        {report.inspectedAt && (
                          <div className="flex items-center space-x-1">
                            <Calendar className="h-4 w-4" />
                            <span>{new Date(report.inspectedAt).toLocaleDateString('zh-CN')}</span>
                          </div>
                        )}
                        {report.inspector && (
                          <span>检验员: {report.inspector}</span>
                        )}
                      </div>
                    </div>
                    <div className="flex items-center space-x-2">
                      <Button variant="outline" size="sm">
                        <Eye className="h-4 w-4 mr-2" />
                        查看详情
                      </Button>
                    </div>
                  </div>
                </div>
              ))}
            </div>
          )}
        </CardContent>
      </Card>
    </div>
  )
}

// 生产资料组件
function ProductionDocuments({ project }: { project: any }) {
  const getStatusColor = (status: string) => {
    const colors: Record<string, string> = {
      PLANNED: 'bg-gray-100 text-gray-800',
      IN_PRODUCTION: 'bg-blue-100 text-blue-800',
      COMPLETED: 'bg-green-100 text-green-800',
      CANCELLED: 'bg-red-100 text-red-800',
      ON_HOLD: 'bg-yellow-100 text-yellow-800',
      AVAILABLE: 'bg-green-100 text-green-800',
      RESERVED: 'bg-yellow-100 text-yellow-800',
      IN_TRANSIT: 'bg-blue-100 text-blue-800',
      QUALITY_HOLD: 'bg-orange-100 text-orange-800',
      EXPIRED: 'bg-red-100 text-red-800',
      DAMAGED: 'bg-red-100 text-red-800'
    }
    return colors[status] || 'bg-gray-100 text-gray-800'
  }

  const getStatusLabel = (status: string) => {
    const labels: Record<string, string> = {
      PLANNED: '计划中',
      IN_PRODUCTION: '生产中',
      COMPLETED: '已完成',
      CANCELLED: '已取消',
      ON_HOLD: '暂停',
      AVAILABLE: '可用',
      RESERVED: '已预留',
      IN_TRANSIT: '在途',
      QUALITY_HOLD: '质检中',
      EXPIRED: '已过期',
      DAMAGED: '已损坏'
    }
    return labels[status] || status
  }

  return (
    <div className="space-y-6">
      {/* 生产订单 */}
      <Card>
        <CardHeader>
          <CardTitle className="flex items-center space-x-2">
            <Package className="h-5 w-5" />
            <span>生产订单</span>
            <Badge variant="secondary">{project.productionOrders?.length || 0}</Badge>
          </CardTitle>
          <CardDescription>
            产品生产订单和进度跟踪
          </CardDescription>
        </CardHeader>
        <CardContent>
          {project.productionOrders?.length === 0 ? (
            <div className="text-center py-8">
              <Package className="mx-auto h-12 w-12 text-gray-400 mb-4" />
              <p className="text-gray-500">暂无生产订单</p>
            </div>
          ) : (
            <div className="space-y-4">
              {project.productionOrders.map((order: any) => (
                <div key={order.id} className="border rounded-lg p-4">
                  <div className="flex items-start justify-between">
                    <div className="space-y-2">
                      <div className="flex items-center space-x-2">
                        <Badge className={getStatusColor(order.status)}>
                          {getStatusLabel(order.status)}
                        </Badge>
                        <Badge variant="outline">v{order.version}</Badge>
                      </div>
                      <h4 className="font-medium">订单号: {order.orderNumber}</h4>
                      <p className="text-sm">生产数量: {order.quantity}</p>
                      {order.cost && (
                        <p className="text-sm text-green-600">成本: ¥{order.cost.toLocaleString()}</p>
                      )}
                      <div className="flex items-center space-x-4 text-sm text-gray-500">
                        {order.startDate && (
                          <div className="flex items-center space-x-1">
                            <Calendar className="h-4 w-4" />
                            <span>开始: {new Date(order.startDate).toLocaleDateString('zh-CN')}</span>
                          </div>
                        )}
                        {order.endDate && (
                          <div className="flex items-center space-x-1">
                            <Calendar className="h-4 w-4" />
                            <span>结束: {new Date(order.endDate).toLocaleDateString('zh-CN')}</span>
                          </div>
                        )}
                      </div>
                    </div>
                    <div className="flex items-center space-x-2">
                      <Button variant="outline" size="sm">
                        <Eye className="h-4 w-4 mr-2" />
                        查看详情
                      </Button>
                    </div>
                  </div>
                </div>
              ))}
            </div>
          )}
        </CardContent>
      </Card>

      {/* 库存信息 */}
      <Card>
        <CardHeader>
          <CardTitle className="flex items-center space-x-2">
            <FolderOpen className="h-5 w-5" />
            <span>库存信息</span>
            <Badge variant="secondary">0</Badge>
          </CardTitle>
          <CardDescription>
            物料库存和仓储信息
          </CardDescription>
        </CardHeader>
        <CardContent>
          <div className="text-center py-8">
            <FolderOpen className="mx-auto h-12 w-12 text-gray-400 mb-4" />
            <p className="text-gray-500">暂无库存信息</p>
          </div>
        </CardContent>
      </Card>
    </div>
  )
}

// 通用文档组件
function GeneralDocuments({ project }: { project: any }) {
  return (
    <div className="space-y-6">
      {/* 附件管理 */}
      <Card>
        <CardHeader>
          <CardTitle className="flex items-center space-x-2">
            <FileText className="h-5 w-5" />
            <span>附件管理</span>
            <Badge variant="secondary">{project.attachments?.length || 0}</Badge>
          </CardTitle>
          <CardDescription>
            项目相关文档和附件
          </CardDescription>
        </CardHeader>
        <CardContent>
          {project.attachments?.length === 0 ? (
            <div className="text-center py-8">
              <FileText className="mx-auto h-12 w-12 text-gray-400 mb-4" />
              <p className="text-gray-500">暂无附件</p>
            </div>
          ) : (
            <div className="space-y-4">
              {project.attachments.map((attachment: any) => (
                <div key={attachment.id} className="border rounded-lg p-4">
                  <div className="flex items-start justify-between">
                    <div className="space-y-2">
                      <h4 className="font-medium">{attachment.filename}</h4>
                      <div className="flex items-center space-x-4 text-sm text-gray-500">
                        <span>大小: {(attachment.size / 1024).toFixed(2)} KB</span>
                        <span>类型: {attachment.mimeType}</span>
                        <div className="flex items-center space-x-1">
                          <User className="h-4 w-4" />
                          <span>{attachment.uploader.name}</span>
                        </div>
                        <div className="flex items-center space-x-1">
                          <Calendar className="h-4 w-4" />
                          <span>{new Date(attachment.createdAt).toLocaleDateString('zh-CN')}</span>
                        </div>
                      </div>
                    </div>
                    <div className="flex items-center space-x-2">
                      <Button variant="outline" size="sm">
                        <Download className="h-4 w-4 mr-2" />
                        下载
                      </Button>
                    </div>
                  </div>
                </div>
              ))}
            </div>
          )}
        </CardContent>
      </Card>

      {/* 供应商信息 */}
      <Card>
        <CardHeader>
          <CardTitle className="flex items-center space-x-2">
            <Package className="h-5 w-5" />
            <span>供应商信息</span>
            <Badge variant="secondary">0</Badge>
          </CardTitle>
          <CardDescription>
            供应商档案和联系信息
          </CardDescription>
        </CardHeader>
        <CardContent>
          <div className="text-center py-8">
            <Package className="mx-auto h-12 w-12 text-gray-400 mb-4" />
            <p className="text-gray-500">暂无供应商信息</p>
          </div>
        </CardContent>
      </Card>
    </div>
  )
}

export function DocumentManagement({ project }: DocumentManagementProps) {
  return (
    <div className="space-y-6">
      {/* 页面标题 */}
      <div className="flex items-center justify-between">
        <div>
          <h2 className="text-2xl font-bold text-gray-900">资料管理</h2>
          <p className="text-gray-600">项目相关文档和资料的综合管理</p>
        </div>
        <div className="flex items-center space-x-4">
          <div className="relative">
            <Search className="absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 h-4 w-4" />
            <Input
              placeholder="搜索资料..."
              className="pl-10 w-64"
            />
          </div>
          <Select>
            <SelectTrigger className="w-32">
              <Filter className="h-4 w-4 mr-2" />
              <SelectValue placeholder="筛选" />
            </SelectTrigger>
            <SelectContent>
              <SelectItem value="all">全部</SelectItem>
              <SelectItem value="recent">最近更新</SelectItem>
              <SelectItem value="design">设计资料</SelectItem>
              <SelectItem value="test">测试资料</SelectItem>
              <SelectItem value="production">生产资料</SelectItem>
            </SelectContent>
          </Select>
        </div>
      </div>

      {/* 资料分类标签页 */}
      <Tabs defaultValue="design" className="w-full">
        <TabsList className="grid w-full grid-cols-4">
          <TabsTrigger value="design">设计资料</TabsTrigger>
          <TabsTrigger value="test">测试资料</TabsTrigger>
          <TabsTrigger value="production">生产资料</TabsTrigger>
          <TabsTrigger value="general">通用文档</TabsTrigger>
        </TabsList>

        <TabsContent value="design" className="space-y-6">
          <DesignDocuments project={project} />
        </TabsContent>

        <TabsContent value="test" className="space-y-6">
          <TestDocuments project={project} />
        </TabsContent>

        <TabsContent value="production" className="space-y-6">
          <ProductionDocuments project={project} />
        </TabsContent>

        <TabsContent value="general" className="space-y-6">
          <GeneralDocuments project={project} />
        </TabsContent>
      </Tabs>
    </div>
  )
}